#ifndef LASERSPI_H
#define LASERSPI_H

#include <Arduino.h>

#define RX_BUFFER_SIZE 256

struct spi_ring_buffer
{
  unsigned char r_buffer[RX_BUFFER_SIZE];
  int head;
  int tail;
};

//extern spi_ring_buffer rx_buffer;

class LaserSPI
{
public:
  LaserSPI();
  void initSPI();
  void writeChar(char c);
  void writeBuff(const char * str);
  void writeString(String str);
  void flush();
  void peek(void);
  int read(void);
  //if the ring_buffer is not full, the it can not avaiable
  int available(void);
private:

};

extern LaserSPI LCSPI;

#endif // LASERSPI_H
